package com.kedacom.freedomLabel.model.bean;

import android.arch.persistence.room.Ignore;

/**
 * @author licheng
 * @since 2020/2/24 15:33
 */
public abstract class IFirstLetter implements Comparable<IFirstLetterComparable>, IFirstLetterComparable {

    @Ignore
    boolean isSelected;

    public boolean isSelected() {
        return isSelected;
    }

    public void setSelected(boolean selected) {
        isSelected = selected;
    }

    @Override
    public int compareTo(IFirstLetterComparable another) {
        if (getFirstLetter().equals("@") || another.getFirstLetter().equals("#")) {
            return -1;
        } else if (getFirstLetter().equals("#") || another.getFirstLetter().equals("@")) {
            return 1;
        } else {
            return getFirstLetter().compareTo(another.getFirstLetter());
        }
    }
}